package com.project.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.BuyOrderBean;
import com.project.service.IBuyDetailService;
import com.project.service.IBuyOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("buyDetail")
@Api(tags = "采购订单详情")
public class BuyDetailController {
    @Autowired
    private IBuyDetailService detailService;
    @Autowired
    private IBuyOrderService orderService;

    @ApiOperation(value = "分页动态查询采购详情信息")
    @GetMapping("cutByItem")
    public IPage<BuyOrderBean> cutByItem(Integer pageNO, String name, LocalDate startDate, LocalDate endDate) {
        return orderService.cutByItem(pageNO, name, startDate, endDate);
    }

    @ApiOperation(value = "查询采购订单详情")
    @GetMapping("findById")
    public BuyOrderBean findById(Integer id) {
        return detailService.findById(id);
    }



}
